home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / dev / gcc / gcc270_src.lha / gcc-2.7.0-amiga / gcc.info-2 (.txt) < prev    next >
GNU Info File  |  1995-06-16  |  38KB  |  727 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 59 Temple Place - Suite 330
  5. Boston, MA 02111-1307 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995 Free Software
  7. Foundation, Inc.
  8.    Permission is granted to make and distribute verbatim copies of this
  9. manual provided the copyright notice and this permission notice are
  10. preserved on all copies.
  11.    Permission is granted to copy and distribute modified versions of
  12. this manual under the conditions for verbatim copying, provided also
  13. that the sections entitled "GNU General Public License," "Funding for
  14. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  15. included exactly as in the original, and provided that the entire
  16. resulting derived work is distributed under the terms of a permission
  17. notice identical to this one.
  18.    Permission is granted to copy and distribute translations of this
  19. manual into another language, under the above conditions for modified
  20. versions, except that the sections entitled "GNU General Public
  21. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  22. `Look And Feel'", and this permission notice, may be included in
  23. translations approved by the Free Software Foundation instead of in the
  24. original English.
  25. File: gcc.info,  Node: Option Summary,  Next: Overall Options,  Up: Invoking GCC
  26. Option Summary
  27. ==============
  28.    Here is a summary of all the options, grouped by type.  Explanations
  29. are in the following sections.
  30. *Overall Options*
  31.      *Note Options Controlling the Kind of Output: Overall Options.
  32.           -c  -S  -E  -o FILE  -pipe  -v  -x LANGUAGE
  33. *C Language Options*
  34.      *Note Options Controlling C Dialect: C Dialect Options.
  35.           -ansi  -fallow-single-precision -fcond-mismatch  -fno-asm
  36.           -fno-builtin  -fsigned-bitfields  -fsigned-char
  37.           -funsigned-bitfields  -funsigned-char  -fwritable-strings
  38.           -traditional  -traditional-cpp  -trigraphs
  39. *C++ Language Options*
  40.      *Note Options Controlling C++ Dialect: C++ Dialect Options.
  41.           -fall-virtual  -fdollars-in-identifiers  -felide-constructors
  42.           -fenum-int-equiv -fexternal-templates  -fhandle-signatures
  43.           -fmemoize-lookups  -fno-default-inline -fno-gnu-keywords
  44.           -fnonnull-objects  -foperator-names  -fstrict-prototype
  45.           -fthis-is-variable -nostdinc++ -traditional  +eN
  46. *Warning Options*
  47.      *Note Options to Request or Suppress Warnings: Warning Options.
  48.           -fsyntax-only  -pedantic  -pedantic-errors
  49.           -w  -W  -Wall  -Waggregate-return  -Wbad-function-cast
  50.           -Wcast-align -Wcast-qual  -Wchar-subscript  -Wcomment
  51.           -Wconversion -Wenum-clash  -Werror  -Wformat
  52.           -Wid-clash-LEN  -Wimplicit  -Wimport  -Winline
  53.           -Wlarger-than-LEN  -Wmissing-declarations
  54.           -Wmissing-prototypes  -Wnested-externs
  55.           -Wno-import  -Woverloaded-virtual -Wparentheses
  56.           -Wpointer-arith  -Wredundant-decls -Wreorder -Wreturn-type -Wshadow
  57.           -Wstrict-prototypes  -Wswitch  -Wsynth  -Wtemplate-debugging
  58.           -Wtraditional  -Wtrigraphs -Wuninitialized  -Wunused
  59.           -Wwrite-strings
  60. *Debugging Options*
  61.      *Note Options for Debugging Your Program or GCC: Debugging Options.
  62.           -a  -dLETTERS  -fpretend-float
  63.           -g  -gLEVEL -gcoff  -gdwarf  -gdwarf+
  64.           -ggdb  -gstabs  -gstabs+  -gxcoff  -gxcoff+
  65.           -p  -pg  -print-file-name=LIBRARY  -print-libgcc-file-name
  66.           -print-prog-name=PROGRAM  -print-search-dirs  -save-temps
  67. *Optimization Options*
  68.      *Note Options that Control Optimization: Optimize Options.
  69.           -fcaller-saves  -fcse-follow-jumps  -fcse-skip-blocks
  70.           -fdelayed-branch   -fexpensive-optimizations
  71.           -ffast-math  -ffloat-store  -fforce-addr  -fforce-mem
  72.           -finline-functions  -fkeep-inline-functions
  73.           -fno-default-inline  -fno-defer-pop  -fno-function-cse
  74.           -fno-inline  -fno-peephole  -fomit-frame-pointer
  75.           -frerun-cse-after-loop  -fschedule-insns
  76.           -fschedule-insns2  -fstrength-reduce  -fthread-jumps
  77.           -funroll-all-loops  -funroll-loops
  78.           -O  -O0  -O1  -O2  -O3
  79. *Preprocessor Options*
  80.      *Note Options Controlling the Preprocessor: Preprocessor Options.
  81.           -AQUESTION(ANSWER)  -C  -dD  -dM  -dN
  82.           -DMACRO[=DEFN]  -E  -H
  83.           -idirafter DIR
  84.           -include FILE  -imacros FILE
  85.           -iprefix FILE  -iwithprefix DIR
  86.           -iwithprefixbefore DIR  -isystem DIR
  87.           -M  -MD  -MM  -MMD  -MG  -nostdinc  -P  -trigraphs
  88.           -undef  -UMACRO  -Wp,OPTION
  89. *Assembler Option*
  90.      *Note Passing Options to the Assembler: Assembler Options.
  91.           -Wa,OPTION
  92. *Linker Options*
  93.      *Note Options for Linking: Link Options.
  94.           OBJECT-FILE-NAME  -lLIBRARY
  95.           -nostartfiles  -nodefaultlibs  -nostdlib
  96.           -s  -static  -shared  -symbolic
  97.           -Wl,OPTION  -Xlinker OPTION
  98.           -u SYMBOL
  99. *Directory Options*
  100.      *Note Options for Directory Search: Directory Options.
  101.           -BPREFIX  -IDIR  -I-  -LDIR
  102. *Target Options*
  103.      *Note Target Options::.
  104.           -b MACHINE  -V VERSION
  105. *Machine Dependent Options*
  106.      *Note Hardware Models and Configurations: Submodel Options.
  107.           *M680x0 Options*
  108.           -m68000  -m68020  -m68020-40  -m68030  -m68040  -m68881
  109.           -mbitfield  -mc68000  -mc68020  -mfpa  -mnobitfield
  110.           -mrtd  -mshort  -msoft-float
  111.           
  112.           *VAX Options*
  113.           -mg  -mgnu  -munix
  114.           
  115.           *SPARC Options*
  116.           -mapp-regs  -mcypress  -mepilogue  -mflat  -mfpu  -mhard-float
  117.           -mhard-quad-float  -mno-app-regs  -mno-flat  -mno-fpu
  118.           -mno-epilogue  -mno-unaligned-doubles
  119.           -msoft-float  -msoft-quad-float
  120.           -msparclite  -msupersparc  -munaligned-doubles  -mv8
  121.           
  122.           SPARC V9 compilers support the following options
  123.           in addition to the above:
  124.           
  125.           -mmedlow  -mmedany
  126.           -mint32  -mint64  -mlong32  -mlong64
  127.           -mno-stack-bias  -mstack-bias
  128.           
  129.           *Convex Options*
  130.           -mc1  -mc2  -mc32  -mc34  -mc38
  131.           -margcount  -mnoargcount
  132.           -mlong32  -mlong64
  133.           -mvolatile-cache  -mvolatile-nocache
  134.           
  135.           *AMD29K Options*
  136.           -m29000  -m29050  -mbw  -mnbw  -mdw  -mndw
  137.           -mlarge  -mnormal  -msmall
  138.           -mkernel-registers  -mno-reuse-arg-regs
  139.           -mno-stack-check  -mno-storem-bug
  140.           -mreuse-arg-regs  -msoft-float  -mstack-check
  141.           -mstorem-bug  -muser-registers
  142.           
  143.           *ARM Options*
  144.           -mapcs -m2 -m3 -m6 -mbsd -mxopen -mno-symrename
  145.           
  146.           *M88K Options*
  147.           -m88000  -m88100  -m88110  -mbig-pic
  148.           -mcheck-zero-division  -mhandle-large-shift
  149.           -midentify-revision  -mno-check-zero-division
  150.           -mno-ocs-debug-info  -mno-ocs-frame-position
  151.           -mno-optimize-arg-area  -mno-serialize-volatile
  152.           -mno-underscores  -mocs-debug-info
  153.           -mocs-frame-position  -moptimize-arg-area
  154.           -mserialize-volatile  -mshort-data-NUM  -msvr3
  155.           -msvr4  -mtrap-large-shift  -muse-div-instruction
  156.           -mversion-03.00  -mwarn-passed-structs
  157.           
  158.           *RS/6000 and PowerPC Options*
  159.           -mcpu=CPU  TYPE
  160.           -mpower  -mno-power  -mpower2  -mno-power2
  161.           -mpowerpc  -mno-powerpc
  162.           -mpowerpc-gpopt  -mno-powerpc-gpopt
  163.           -mpowerpc-gfxopt  -mno-powerpc-gfxopt
  164.           -mnew-mnemonics  -mno-new-mnemonics
  165.           -mfull-toc   -mminimal-toc  -mno-fop-in-toc  -mno-sum-in-toc
  166.           -msoft-float  -mhard-float -mmultiple -mno-multiple
  167.           -mstring -mno-string -mbit-align -mno-bit-align
  168.           -mstrict-align -mno-strict-align -mrelocatable -mno-relocatable
  169.           -mtoc -mno-toc -mtraceback -mno-traceback
  170.           -mlittle -mlittle-endian -mbig -mbig-endian
  171.           
  172.           *RT Options*
  173.           -mcall-lib-mul  -mfp-arg-in-fpregs  -mfp-arg-in-gregs
  174.           -mfull-fp-blocks  -mhc-struct-return  -min-line-mul
  175.           -mminimum-fp-blocks  -mnohc-struct-return
  176.           
  177.           *MIPS Options*
  178.           -mabicalls  -mcpu=CPU  TYPE  -membedded-data
  179.           -membedded-pic  -mfp32  -mfp64  -mgas  -mgp32  -mgp64
  180.           -mgpopt  -mhalf-pic  -mhard-float  -mint64 -mips1
  181.           -mips2 -mips3  -mlong64  -mlong-calls  -mmemcpy
  182.           -mmips-as  -mmips-tfile  -mno-abicalls
  183.           -mno-embedded-data  -mno-embedded-pic
  184.           -mno-gpopt  -mno-long-calls
  185.           -mno-memcpy  -mno-mips-tfile  -mno-rnames  -mno-stats
  186.           -mrnames -msoft-float
  187.           -m4650 -msingle-float -mmad
  188.           -mstats  -EL  -EB  -G NUM  -nocpp
  189.           
  190.           *i386 Options*
  191.           -m486  -m386 -mieee-fp  -mno-fancy-math-387
  192.           -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib
  193.           -mno-wide-multiply -mrtd -malign-double
  194.           -mreg-alloc=LIST -mregparm=NUM
  195.           -malign-jumps=NUM -malign-loops=NUM
  196.           -malign-functions=NUM
  197.           
  198.           *HPPA Options*
  199.           -mdisable-fpregs  -mdisable-indexing  -mfast-indirect-calls
  200.           -mgas  -mjump-in-delay -mlong-millicode-calls -mno-disable-fpregs
  201.           -mno-disable-indexing -mno-fast-indirect-calls -mno-gas
  202.           -mno-jump-in-delay -mno-millicode-long-calls
  203.           -mno-portable-runtime -mno-soft-float -msoft-float
  204.           -mpa-risc-1-0  -mpa-risc-1-1  -mportable-runtime -mschedule=LIST
  205.           
  206.           *Intel 960 Options*
  207.           -mCPU TYPE  -masm-compat  -mclean-linkage
  208.           -mcode-align  -mcomplex-addr  -mleaf-procedures
  209.           -mic-compat  -mic2.0-compat  -mic3.0-compat
  210.           -mintel-asm  -mno-clean-linkage  -mno-code-align
  211.           -mno-complex-addr  -mno-leaf-procedures
  212.           -mno-old-align  -mno-strict-align  -mno-tail-call
  213.           -mnumerics  -mold-align  -msoft-float  -mstrict-align
  214.           -mtail-call
  215.           
  216.           *DEC Alpha Options*
  217.           -mfp-regs  -mno-fp-regs  -mno-soft-float
  218.           -msoft-float
  219.           
  220.           *Clipper Options*
  221.           -mc300 -mc400
  222.           
  223.           *H8/300 Options*
  224.           -mrelax  -mh
  225.           
  226.           *System V Options*
  227.           -Qy  -Qn  -YP,PATHS  -Ym,DIR
  228. *Code Generation Options*
  229.      *Note Options for Code Generation Conventions: Code Gen Options.
  230.           -fcall-saved-REG  -fcall-used-REG
  231.           -ffixed-REG  -finhibit-size-directive
  232.           -fno-common  -fno-ident  -fno-gnu-linker
  233.           -fpcc-struct-return  -fpic  -fPIC
  234.           -freg-struct-return  -fshared-data  -fshort-enums
  235.           -fshort-double  -fvolatile  -fvolatile-global
  236.           -fverbose-asm -fpack-struct +e0  +e1
  237. * Menu:
  238. * Overall Options::     Controlling the kind of output:
  239.                         an executable, object files, assembler files,
  240.                         or preprocessed source.
  241. * C Dialect Options::   Controlling the variant of C language compiled.
  242. * C++ Dialect Options:: Variations on C++.
  243. * Warning Options::     How picky should the compiler be?
  244. * Debugging Options::   Symbol tables, measurements, and debugging dumps.
  245. * Optimize Options::    How much optimization?
  246. * Preprocessor Options:: Controlling header files and macro definitions.
  247.                          Also, getting dependency information for Make.
  248. * Assembler Options::   Passing options to the assembler.
  249. * Link Options::        Specifying libraries and so on.
  250. * Directory Options::   Where to find header files and libraries.
  251.                         Where to find the compiler executable files.
  252. * Target Options::      Running a cross-compiler, or an old version of GNU CC.
  253. File: gcc.info,  Node: Overall Options,  Next: Invoking G++,  Prev: Option Summary,  Up: Invoking GCC
  254. Options Controlling the Kind of Output
  255. ======================================
  256.    Compilation can involve up to four stages: preprocessing, compilation
  257. proper, assembly and linking, always in that order.  The first three
  258. stages apply to an individual source file, and end by producing an
  259. object file; linking combines all the object files (those newly
  260. compiled, and those specified as input) into an executable file.
  261.    For any given input file, the file name suffix determines what kind
  262. of compilation is done:
  263. `FILE.c'
  264.      C source code which must be preprocessed.
  265. `FILE.i'
  266.      C source code which should not be preprocessed.
  267. `FILE.ii'
  268.      C++ source code which should not be preprocessed.
  269. `FILE.m'
  270.      Objective-C source code.  Note that you must link with the library
  271.      `libobjc.a' to make an Objective-C program work.
  272. `FILE.h'
  273.      C header file (not to be compiled or linked).
  274. `FILE.cc'
  275. `FILE.cxx'
  276. `FILE.cpp'
  277. `FILE.C'
  278.      C++ source code which must be preprocessed.  Note that in `.cxx',
  279.      the last two letters must both be literally `x'.  Likewise, `.C'
  280.      refers to a literal capital C.
  281. `FILE.s'
  282.      Assembler code.
  283. `FILE.S'
  284.      Assembler code which must be preprocessed.
  285. `OTHER'
  286.      An object file to be fed straight into linking.  Any file name
  287.      with no recognized suffix is treated this way.
  288.    You can specify the input language explicitly with the `-x' option:
  289. `-x LANGUAGE'
  290.      Specify explicitly the LANGUAGE for the following input files
  291.      (rather than letting the compiler choose a default based on the
  292.      file name suffix).  This option applies to all following input
  293.      files until the next `-x' option.  Possible values for LANGUAGE
  294.      are:
  295.           c  objective-c  c++
  296.           c-header  cpp-output  c++-cpp-output
  297.           assembler  assembler-with-cpp
  298. `-x none'
  299.      Turn off any specification of a language, so that subsequent files
  300.      are handled according to their file name suffixes (as they are if
  301.      `-x' has not been used at all).
  302.    If you only want some of the stages of compilation, you can use `-x'
  303. (or filename suffixes) to tell `gcc' where to start, and one of the
  304. options `-c', `-S', or `-E' to say where `gcc' is to stop.  Note that
  305. some combinations (for example, `-x cpp-output -E' instruct `gcc' to do
  306. nothing at all.
  307.      Compile or assemble the source files, but do not link.  The linking
  308.      stage simply is not done.  The ultimate output is in the form of an
  309.      object file for each source file.
  310.      By default, the object file name for a source file is made by
  311.      replacing the suffix `.c', `.i', `.s', etc., with `.o'.
  312.      Unrecognized input files, not requiring compilation or assembly,
  313.      are ignored.
  314.      Stop after the stage of compilation proper; do not assemble.  The
  315.      output is in the form of an assembler code file for each
  316.      non-assembler input file specified.
  317.      By default, the assembler file name for a source file is made by
  318.      replacing the suffix `.c', `.i', etc., with `.s'.
  319.      Input files that don't require compilation are ignored.
  320.      Stop after the preprocessing stage; do not run the compiler
  321.      proper.  The output is in the form of preprocessed source code,
  322.      which is sent to the standard output.
  323.      Input files which don't require preprocessing are ignored.
  324. `-o FILE'
  325.      Place output in file FILE.  This applies regardless to whatever
  326.      sort of output is being produced, whether it be an executable file,
  327.      an object file, an assembler file or preprocessed C code.
  328.      Since only one output file can be specified, it does not make
  329.      sense to use `-o' when compiling more than one input file, unless
  330.      you are producing an executable file as output.
  331.      If `-o' is not specified, the default is to put an executable file
  332.      in `a.out', the object file for `SOURCE.SUFFIX' in `SOURCE.o', its
  333.      assembler file in `SOURCE.s', and all preprocessed C source on
  334.      standard output.
  335.      Print (on standard error output) the commands executed to run the
  336.      stages of compilation.  Also print the version number of the
  337.      compiler driver program and of the preprocessor and the compiler
  338.      proper.
  339. `-pipe'
  340.      Use pipes rather than temporary files for communication between the
  341.      various stages of compilation.  This fails to work on some systems
  342.      where the assembler is unable to read from a pipe; but the GNU
  343.      assembler has no trouble.
  344. File: gcc.info,  Node: Invoking G++,  Next: C Dialect Options,  Prev: Overall Options,  Up: Invoking GCC
  345. Compiling C++ Programs
  346. ======================
  347.    C++ source files conventionally use one of the suffixes `.C', `.cc',
  348. `cpp', or `.cxx'; preprocessed C++ files use the suffix `.ii'.  GNU CC
  349. recognizes files with these names and compiles them as C++ programs
  350. even if you call the compiler the same way as for compiling C programs
  351. (usually with the name `gcc').
  352.    However, C++ programs often require class libraries as well as a
  353. compiler that understands the C++ language--and under some
  354. circumstances, you might want to compile programs from standard input,
  355. or otherwise without a suffix that flags them as C++ programs.  `g++'
  356. is a program that calls GNU CC with the default language set to C++,
  357. and automatically specifies linking against the GNU class library
  358. libg++.  (1) On many systems, the script `g++' is also installed with
  359. the name `c++'.
  360.    When you compile C++ programs, you may specify many of the same
  361. command-line options that you use for compiling programs in any
  362. language; or command-line options meaningful for C and related
  363. languages; or options that are meaningful only for C++ programs.  *Note
  364. Options Controlling C Dialect: C Dialect Options, for explanations of
  365. options for languages related to C.  *Note Options Controlling C++
  366. Dialect: C++ Dialect Options, for explanations of options that are
  367. meaningful only for C++ programs.
  368.    ---------- Footnotes ----------
  369.    (1)  Prior to release 2 of the compiler, there was a separate `g++'
  370. compiler.  That version was based on GNU CC, but not integrated with
  371. it.  Versions of `g++' with a `1.XX' version number--for example, `g++'
  372. version 1.37 or 1.42--are much less reliable than the versions
  373. integrated with GCC 2.  Moreover, combining G++ `1.XX' with a version 2
  374. GCC will simply not work.
  375. File: gcc.info,  Node: C Dialect Options,  Next: C++ Dialect Options,  Prev: Invoking G++,  Up: Invoking GCC
  376. Options Controlling C Dialect
  377. =============================
  378.    The following options control the dialect of C (or languages derived
  379. from C, such as C++ and Objective C) that the compiler accepts:
  380. `-ansi'
  381.      Support all ANSI standard C programs.
  382.      This turns off certain features of GNU C that are incompatible
  383.      with ANSI C, such as the `asm', `inline' and `typeof' keywords, and
  384.      predefined macros such as `unix' and `vax' that identify the type
  385.      of system you are using.  It also enables the undesirable and
  386.      rarely used ANSI trigraph feature, and disallows `$' as part of
  387.      identifiers.
  388.      The alternate keywords `__asm__', `__extension__', `__inline__'
  389.      and `__typeof__' continue to work despite `-ansi'.  You would not
  390.      want to use them in an ANSI C program, of course, but it is useful
  391.      to put them in header files that might be included in compilations
  392.      done with `-ansi'.  Alternate predefined macros such as `__unix__'
  393.      and `__vax__' are also available, with or without `-ansi'.
  394.      The `-ansi' option does not cause non-ANSI programs to be rejected
  395.      gratuitously.  For that, `-pedantic' is required in addition to
  396.      `-ansi'.  *Note Warning Options::.
  397.      The macro `__STRICT_ANSI__' is predefined when the `-ansi' option
  398.      is used.  Some header files may notice this macro and refrain from
  399.      declaring certain functions or defining certain macros that the
  400.      ANSI standard doesn't call for; this is to avoid interfering with
  401.      any programs that might use these names for other things.
  402.      The functions `alloca', `abort', `exit', and `_exit' are not
  403.      builtin functions when `-ansi' is used.
  404. `-fno-asm'
  405.      Do not recognize `asm', `inline' or `typeof' as a keyword, so that
  406.      code can use these words as identifiers.  You can use the keywords
  407.      `__asm__', `__inline__' and `__typeof__' instead.  `-ansi' implies
  408.      `-fno-asm'.
  409.      In C++, this switch only affects the `typeof' keyword, since `asm'
  410.      and `inline' are standard keywords.  You may want to use the
  411.      `-fno-gnu-keywords' flag instead, as it also disables the other,
  412.      C++-specific, extension keywords such as `headof'.
  413. `-fno-builtin'
  414.      Don't recognize builtin functions that do not begin with two
  415.      leading underscores.  Currently, the functions affected include
  416.      `abort', `abs', `alloca', `cos', `exit', `fabs', `ffs', `labs',
  417.      `memcmp', `memcpy', `sin', `sqrt', `strcmp', `strcpy', and
  418.      `strlen'.
  419.      GCC normally generates special code to handle certain builtin
  420.      functions more efficiently; for instance, calls to `alloca' may
  421.      become single instructions that adjust the stack directly, and
  422.      calls to `memcpy' may become inline copy loops.  The resulting
  423.      code is often both smaller and faster, but since the function
  424.      calls no longer appear as such, you cannot set a breakpoint on
  425.      those calls, nor can you change the behavior of the functions by
  426.      linking with a different library.
  427.      The `-ansi' option prevents `alloca' and `ffs' from being builtin
  428.      functions, since these functions do not have an ANSI standard
  429.      meaning.
  430. `-trigraphs'
  431.      Support ANSI C trigraphs.  You don't want to know about this
  432.      brain-damage.  The `-ansi' option implies `-trigraphs'.
  433. `-traditional'
  434.      Attempt to support some aspects of traditional C compilers.
  435.      Specifically:
  436.         * All `extern' declarations take effect globally even if they
  437.           are written inside of a function definition.  This includes
  438.           implicit declarations of functions.
  439.         * The newer keywords `typeof', `inline', `signed', `const' and
  440.           `volatile' are not recognized.  (You can still use the
  441.           alternative keywords such as `__typeof__', `__inline__', and
  442.           so on.)
  443.         * Comparisons between pointers and integers are always allowed.
  444.         * Integer types `unsigned short' and `unsigned char' promote to
  445.           `unsigned int'.
  446.         * Out-of-range floating point literals are not an error.
  447.         * Certain constructs which ANSI regards as a single invalid
  448.           preprocessing number, such as `0xe-0xd', are treated as
  449.           expressions instead.
  450.         * String "constants" are not necessarily constant; they are
  451.           stored in writable space, and identical looking constants are
  452.           allocated separately.  (This is the same as the effect of
  453.           `-fwritable-strings'.)
  454.         * All automatic variables not declared `register' are preserved
  455.           by `longjmp'.  Ordinarily, GNU C follows ANSI C: automatic
  456.           variables not declared `volatile' may be clobbered.
  457.         * The character escape sequences `\x' and `\a' evaluate as the
  458.           literal characters `x' and `a' respectively.  Without
  459.           `-traditional', `\x' is a prefix for the hexadecimal
  460.           representation of a character, and `\a' produces a bell.
  461.         * In C++ programs, assignment to `this' is permitted with
  462.           `-traditional'.  (The option `-fthis-is-variable' also has
  463.           this effect.)
  464.      You may wish to use `-fno-builtin' as well as `-traditional' if
  465.      your program uses names that are normally GNU C builtin functions
  466.      for other purposes of its own.
  467.      You cannot use `-traditional' if you include any header files that
  468.      rely on ANSI C features.  Some vendors are starting to ship
  469.      systems with ANSI C header files and you cannot use `-traditional'
  470.      on such systems to compile files that include any system headers.
  471.      In the preprocessor, comments convert to nothing at all, rather
  472.      than to a space.  This allows traditional token concatenation.
  473.      In preprocessing directive, the `#' symbol must appear as the first
  474.      character of a line.
  475.      In the preprocessor, macro arguments are recognized within string
  476.      constants in a macro definition (and their values are stringified,
  477.      though without additional quote marks, when they appear in such a
  478.      context).  The preprocessor always considers a string constant to
  479.      end at a newline.
  480.      The predefined macro `__STDC__' is not defined when you use
  481.      `-traditional', but `__GNUC__' is (since the GNU extensions which
  482.      `__GNUC__' indicates are not affected by `-traditional').  If you
  483.      need to write header files that work differently depending on
  484.      whether `-traditional' is in use, by testing both of these
  485.      predefined macros you can distinguish four situations: GNU C,
  486.      traditional GNU C, other ANSI C compilers, and other old C
  487.      compilers.  The predefined macro `__STDC_VERSION__' is also not
  488.      defined when you use `-traditional'.  *Note Standard Predefined
  489.      Macros: (cpp.info)Standard Predefined, for more discussion of
  490.      these and other predefined macros.
  491.      The preprocessor considers a string constant to end at a newline
  492.      (unless the newline is escaped with `\').  (Without `-traditional',
  493.      string constants can contain the newline character as typed.)
  494. `-traditional-cpp'
  495.      Attempt to support some aspects of traditional C preprocessors.
  496.      This includes the last five items in the table immediately above,
  497.      but none of the other effects of `-traditional'.
  498. `-fcond-mismatch'
  499.      Allow conditional expressions with mismatched types in the second
  500.      and third arguments.  The value of such an expression is void.
  501. `-funsigned-char'
  502.      Let the type `char' be unsigned, like `unsigned char'.
  503.      Each kind of machine has a default for what `char' should be.  It
  504.      is either like `unsigned char' by default or like `signed char' by
  505.      default.
  506.      Ideally, a portable program should always use `signed char' or
  507.      `unsigned char' when it depends on the signedness of an object.
  508.      But many programs have been written to use plain `char' and expect
  509.      it to be signed, or expect it to be unsigned, depending on the
  510.      machines they were written for.  This option, and its inverse, let
  511.      you make such a program work with the opposite default.
  512.      The type `char' is always a distinct type from each of `signed
  513.      char' or `unsigned char', even though its behavior is always just
  514.      like one of those two.
  515. `-fsigned-char'
  516.      Let the type `char' be signed, like `signed char'.
  517.      Note that this is equivalent to `-fno-unsigned-char', which is the
  518.      negative form of `-funsigned-char'.  Likewise, the option
  519.      `-fno-signed-char' is equivalent to `-funsigned-char'.
  520. `-fsigned-bitfields'
  521. `-funsigned-bitfields'
  522. `-fno-signed-bitfields'
  523. `-fno-unsigned-bitfields'
  524.      These options control whether a bitfield is signed or unsigned,
  525.      when the declaration does not use either `signed' or `unsigned'.
  526.      By default, such a bitfield is signed, because this is consistent:
  527.      the basic integer types such as `int' are signed types.
  528.      However, when `-traditional' is used, bitfields are all unsigned
  529.      no matter what.
  530. `-fwritable-strings'
  531.      Store string constants in the writable data segment and don't
  532.      uniquize them.  This is for compatibility with old programs which
  533.      assume they can write into string constants.  The option
  534.      `-traditional' also has this effect.
  535.      Writing into string constants is a very bad idea; "constants"
  536.      should be constant.
  537. `-fallow-single-precision'
  538.      Do not promote single precision math operations to double
  539.      precision, even when compiling with `-traditional'.
  540.      Traditional K&R C promotes all floating point operations to double
  541.      precision, regardless of the sizes of the operands.   On the
  542.      architecture for which you are compiling, single precision may be
  543.      faster than double precision.   If you must use `-traditional',
  544.      but want to use single precision operations when the operands are
  545.      single precision, use this option.   This option has no effect
  546.      when compiling with ANSI or GNU C conventions (the default).
  547. File: gcc.info,  Node: C++ Dialect Options,  Next: Warning Options,  Prev: C Dialect Options,  Up: Invoking GCC
  548. Options Controlling C++ Dialect
  549. ===============================
  550.    This section describes the command-line options that are only
  551. meaningful for C++ programs; but you can also use most of the GNU
  552. compiler options regardless of what language your program is in.  For
  553. example, you might compile a file `firstClass.C' like this:
  554.      g++ -g -felide-constructors -O -c firstClass.C
  555. In this example, only `-felide-constructors' is an option meant only
  556. for C++ programs; you can use the other options with any language
  557. supported by GNU CC.
  558.    Here is a list of options that are *only* for compiling C++ programs:
  559. `-fno-access-control'
  560.      Turn off all access checking.  This switch is mainly useful for
  561.      working around bugs in the access control code.
  562. `-fall-virtual'
  563.      Treat all possible member functions as virtual, implicitly.  All
  564.      member functions (except for constructor functions and `new' or
  565.      `delete' member operators) are treated as virtual functions of the
  566.      class where they appear.
  567.      This does not mean that all calls to these member functions will
  568.      be made through the internal table of virtual functions.  Under
  569.      some circumstances, the compiler can determine that a call to a
  570.      given virtual function can be made directly; in these cases the
  571.      calls are direct in any case.
  572. `-fcheck-new'
  573.      Check that the pointer returned by `operator new' is non-null
  574.      before attempting to modify the storage allocated.  The current
  575.      Working Paper requires that `operator new' never return a null
  576.      pointer, so this check is normally unnecessary.
  577. `-fconserve-space'
  578.      Put uninitialized or runtime-initialized global variables into the
  579.      common segment, as C does.  This saves space in the executable at
  580.      the cost of not diagnosing duplicate definitions.  If you compile
  581.      with this flag and your program mysteriously crashes after
  582.      `main()' has completed, you may have an object that is being
  583.      destroyed twice because two definitions were merged.
  584. `-fdollars-in-identifiers'
  585.      Accept `$' in identifiers.  You can also explicitly prohibit use of
  586.      `$' with the option `-fno-dollars-in-identifiers'.  (GNU C++
  587.      allows `$' by default on some target systems but not others.)
  588.      Traditional C allowed the character `$' to form part of
  589.      identifiers.  However, ANSI C and C++ forbid `$' in identifiers.
  590. `-fenum-int-equiv'
  591.      Anachronistically permit implicit conversion of `int' to
  592.      enumeration types.  Current C++ allows conversion of `enum' to
  593.      `int', but not the other way around.
  594. `-fexternal-templates'
  595.      Cause template instantiations to obey `#pragma interface' and
  596.      `implementation'; template instances are emitted or not according
  597.      to the location of the template definition.  *Note Template
  598.      Instantiation::, for more information.
  599. `-falt-external-templates'
  600.      Similar to -fexternal-templates, but template instances are
  601.      emitted or not according to the place where they are first
  602.      instantiated.  *Note Template Instantiation::, for more
  603.      information.
  604. `-fno-gnu-keywords'
  605.      Do not recognize `classof', `headof', `signature', `sigof' or
  606.      `typeof' as a keyword, so that code can use these words as
  607.      identifiers.  You can use the keywords `__classof__',
  608.      `__headof__', `__signature__', `__sigof__', and `__typeof__'
  609.      instead.  `-ansi' implies `-fno-gnu-keywords'.
  610. `-fno-implicit-templates'
  611.      Never emit code for templates which are instantiated implicitly
  612.      (i.e. by use); only emit code for explicit instantiations.  *Note
  613.      Template Instantiation::, for more information.
  614. `-fhandle-signatures'
  615.      Recognize the `signature' and `sigof' keywords for specifying
  616.      abstract types.  The default (`-fno-handle-signatures') is not to
  617.      recognize them.  *Note Type Abstraction using Signatures: C++
  618.      Signatures.
  619. `-fhuge-objects'
  620.      Support virtual function calls for objects that exceed the size
  621.      representable by a `short int'.  Users should not use this flag by
  622.      default; if you need to use it, the compiler will tell you so.  If
  623.      you compile any of your code with this flag, you must compile
  624.      *all* of your code with this flag (including libg++, if you use
  625.      it).
  626.      This flag is not useful when compiling with -fvtable-thunks.
  627. `-fno-implement-inlines'
  628.      To save space, do not emit out-of-line copies of inline functions
  629.      controlled by `#pragma implementation'.  This will cause linker
  630.      errors if these functions are not inlined everywhere they are
  631.      called.
  632. `-fmemoize-lookups'
  633. `-fsave-memoized'
  634.      Use heuristics to compile faster.  These heuristics are not
  635.      enabled by default, since they are only effective for certain
  636.      input files.  Other input files compile more slowly.
  637.      The first time the compiler must build a call to a member function
  638.      (or reference to a data member), it must (1) determine whether the
  639.      class implements member functions of that name; (2) resolve which
  640.      member function to call (which involves figuring out what sorts of
  641.      type conversions need to be made); and (3) check the visibility of
  642.      the member function to the caller.  All of this adds up to slower
  643.      compilation.  Normally, the second time a call is made to that
  644.      member function (or reference to that data member), it must go
  645.      through the same lengthy process again.  This means that code like
  646.      this:
  647.           cout << "This " << p << " has " << n << " legs.\n";
  648.      makes six passes through all three steps.  By using a software
  649.      cache, a "hit" significantly reduces this cost.  Unfortunately,
  650.      using the cache introduces another layer of mechanisms which must
  651.      be implemented, and so incurs its own overhead.
  652.      `-fmemoize-lookups' enables the software cache.
  653.      Because access privileges (visibility) to members and member
  654.      functions may differ from one function context to the next, G++
  655.      may need to flush the cache.  With the `-fmemoize-lookups' flag,
  656.      the cache is flushed after every function that is compiled.  The
  657.      `-fsave-memoized' flag enables the same software cache, but when
  658.      the compiler determines that the context of the last function
  659.      compiled would yield the same access privileges of the next
  660.      function to compile, it preserves the cache.  This is most helpful
  661.      when defining many member functions for the same class: with the
  662.      exception of member functions which are friends of other classes,
  663.      each member function has exactly the same access privileges as
  664.      every other, and the cache need not be flushed.
  665.      The code that implements these flags has rotted; you should
  666.      probably avoid using them.
  667. `-fstrict-prototype'
  668.      Within an `extern "C"' linkage specification, treat a function
  669.      declaration with no arguments, such as `int foo ();', as declaring
  670.      the function to take no arguments.  Normally, such a declaration
  671.      means that the function `foo' can take any combination of
  672.      arguments, as in C.  `-pedantic' implies `-fstrict-prototype'
  673.      unless overridden with `-fno-strict-prototype'.
  674.      This flag no longer affects declarations with C++ linkage.
  675. `-fno-nonnull-objects'
  676.      Don't assume that a reference is initialized to refer to a valid
  677.      object.  Although the current C++ Working Paper prohibits null
  678.      references, some old code may rely on them, and you can use
  679.      `-fno-nonnull-objects' to turn on checking.
  680.      At the moment, the compiler only does this checking for
  681.      conversions to virtual base classes.
  682. `-foperator-names'
  683.      Recognize the operator name keywords `and', `bitand', `bitor',
  684.      `compl', `not', `or' and `xor' as synonyms for the symbols they
  685.      refer to.  `-ansi' implies `-foperator-names'.
  686. `-fthis-is-variable'
  687.      Permit assignment to `this'.  The incorporation of user-defined
  688.      free store management into C++ has made assignment to `this' an
  689.      anachronism.  Therefore, by default it is invalid to assign to
  690.      `this' within a class member function; that is, GNU C++ treats
  691.      `this' in a member function of class `X' as a non-lvalue of type
  692.      `X *'.  However, for backwards compatibility, you can make it
  693.      valid with `-fthis-is-variable'.
  694. `-fvtable-thunks'
  695.      Use `thunks' to implement the virtual function dispatch table
  696.      (`vtable').  The traditional (cfront-style) approach to
  697.      implementing vtables was to store a pointer to the function and two
  698.      offsets for adjusting the `this' pointer at the call site.  Newer
  699.      implementations store a single pointer to a `thunk' function which
  700.      does any necessary adjustment and then calls the target function.
  701.      This option also enables a heuristic for controlling emission of
  702.      vtables; if a class has any non-inline virtual functions, the
  703.      vtable will be emitted in the translation unit containing the
  704.      first one of those.
  705. `-nostdinc++'
  706.      Do not search for header files in the standard directories
  707.      specific to C++, but do still search the other standard
  708.      directories.  (This option is used when building libg++.)
  709. `-traditional'
  710.      For C++ programs (in addition to the effects that apply to both C
  711.      and C++), this has the same effect as `-fthis-is-variable'.  *Note
  712.      Options Controlling C Dialect: C Dialect Options.
  713.    In addition, these optimization, warning, and code generation options
  714. have meanings only for C++ programs:
  715. `-fno-default-inline'
  716.      Do not assume `inline' for functions defined inside a class scope.
  717.      *Note Options That Control Optimization: Optimize Options.
  718. `-Wenum-clash'
  719. `-Woverloaded-virtual'
  720. `-Wtemplate-debugging'
  721.      Warnings that apply only to C++ programs.  *Note Options to
  722.      Request or Suppress Warnings: Warning Options.
  723. `+eN'
  724.      Control how virtual function definitions are used, in a fashion
  725.      compatible with `cfront' 1.x.  *Note Options for Code Generation
  726.      Conventions: Code Gen Options.
  727.